import request from '@/utils/request'

// 编辑详情
export function getFindById(id) {
  return request.get('/outStorage/findById/' + id)
}

// 删除 
export function deleteById(id) {
  return request.delete('/outStorage/del/' + id)
}

// 详情
export function getDetail(id) {
  return request.get('/outStorage/detail/' + id)
}


//获取分页数据 
export function page(form, pageSize, currentPage) {
  return request.post('/outStorage/page', {
    param: form,
    pageSize: pageSize,
    pageNo: currentPage
  })
}

//获取配件分页数据 
export function partsPage(form, pageSize, currentPage) {
  return request.post('/outStorage/partsPage', {
    param: form,
    pageSize: pageSize,
    pageNo: currentPage
  })
}
/**
 * 配件分页接口
 * @param {*} form 
 * @param {*} pageSize 
 * @param {*} currentPage 
 */
export function outStoragePartsDetailPage(form, pageSize, currentPage) {
  return request.post('/outStorage/partsDetailPage', {
    param: form,
    pageSize: pageSize,
    pageNo: currentPage
  })
}


// 获取出库编号
export function getStorageCode() {
  return request.get('/outStorage/getStorageCode')
}

//新增 
export function add(form) {
  return request.post(`/outStorage/save?isAudit=${form.isAudit}`, form)
}

//修改
export function update(form) {
  return request.put(`/outStorage/save?isAudit=${form.isAudit}`, form)
}


// 根据来源单号查询配件
export function findSourceCode(outStorageType, sourceCode) {
  return request.get(`/outStorage/findSourceCode/${outStorageType}/${sourceCode}`)
}

// 服务用料查询
export function picking(id) {
  return request.get(`/outStorage/picking/${id}`)
}

// 出库审记录
export function auditRecords(id) {
  return request.get(`/outStorage/auditRecords/${id}`)
}

// 出库审核状态更改
export function auditStatus(parmas) {
  return request.get(`/outStorage/auditStatus/${parmas.id}/${parmas.auditStatus}`, parmas)
}
